from tools.ChackBase import ChackBase


class GoodsConfig:
    def __init__(self):
        self.goodsId = None
        self.name = None
        self.CHS_name = None
        self.isResource = None
        self.showType = None
        self.goodsType = None
        self.goodsSubType = None
        self.goodsEffectType = None
        self.goodsEffectExpr = None
        self.isRepeat = None
        self.maxCount = None
        self.quality = None
        self.desc = None
        self.CHS_desc = None
        self.sortRank = None
        self.bigIconRes = None
        self.iconRes = None
        self.liIconRes = None
        self.redPoint = None
        self.obtainWay = None
        self.treasureFlag = None
        self.animationType = None
        self.boxUseTips = None
        self.unlockId = None
        self.duration = None
        self.goto = None
        self.dataList = None

    def SetData(self, dataList):
        self.goodsId = ChackBase.ChackInt(dataList[0])
        self.name = dataList[1]
        self.CHS_name = dataList[2]
        self.isResource = ChackBase.ChackInt(dataList[3])
        self.showType = ChackBase.ChackInt(dataList[4])
        self.goodsType = ChackBase.ChackInt(dataList[5])
        self.goodsSubType = ChackBase.ChackInt(dataList[6])
        self.isRepeat = ChackBase.ChackInt(dataList[9])
        self.maxCount = ChackBase.ChackInt(dataList[10])
        self.quality = ChackBase.ChackInt(dataList[11])
        self.desc = dataList[12]
        self.CHS_desc = dataList[13]
        self.sortRank = ChackBase.ChackInt(dataList[14])
        self.bigIconRes = dataList[15]
        self.iconRes = dataList[16]
        self.liIconRes = dataList[17]
        self.redPoint = ChackBase.ChackInt(dataList[18])
        self.obtainWay = dataList[19]
        self.treasureFlag = ChackBase.ChackInt(dataList[20])
        self.animationType = ChackBase.ChackInt(dataList[21])
        self.boxUseTips = dataList[22]
        self.unlockId = ChackBase.ChackInt(dataList[23])
        self.duration = ChackBase.ChackInt(dataList[24])
        self.goto = dataList[25]

    def SetList(self, dataList):
        tempList = []
        for item in dataList:
            item = ChackBase.ToStr(item)
            tempList.append(item)
        self.dataList = tuple(tempList)

    def PrintData(self):
        print(self.goodsId)
        print(self.name)
        print(self.CHS_name)
        print(self.isResource)
        print(self.showType)
        print(self.goodsType)
        print(self.goodsSubType)
        print(self.goodsEffectType)
        print(self.goodsEffectExpr)
        print(self.isRepeat)
        print(self.maxCount)
        print(self.quality)
        print(self.desc)
        print(self.CHS_desc)
        print(self.sortRank)
        print(self.bigIconRes)
        print(self.iconRes)
        print(self.liIconRes)
        print(self.redPoint)
        print(self.obtainWay)
        print(self.treasureFlag)
        print(self.animationType)
        print(self.boxUseTips)
        print(self.unlockId)
        print(self.duration)
        print(self.goto)
